const compiler = require('vue-template-compiler');

const fs = require('fs');
const { promisify } = require('util');

const readFileSync = promisify(fs.readFile);
const witeFileSync = promisify(fs.writeFile);

async function main() {
  const content = await readFileSync('./src/components/HelloWorld.vue');
  const result = compiler.parseComponent(content.toString());
  console.log('====================================');
  console.log(result);
  console.log('====================================');
  witeFileSync('./HelloWorld.js', JSON.stringify(result.staticRenderFns));
}

main();
